package com.tansun.ruledata.data.entity;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.hibernate.validator.constraints.Length;

import com.alibaba.fastjson.JSON;
import com.tansun.easycare.core.persistence.BaseEntity;

/**
 * 规则日志Entity
 * @author lph
 * @version 2018-07-23
 */
public class DeployRuleLogs extends BaseEntity{
	
	private static final long serialVersionUID = 1L;
	private String projectCode;		// project_code
	private String ruleflowid;		// ruleflowid
	private String ruleflowCode;
	private String version;
	private String enterPointer;		// enter_pointer
	private String runTime;		// run_time
	private String issuccess;		// issuccess
	private String ruleParam;		// rule_param
	private String ruleResult;		// rule_result
	private String logContent;		// log_content
	private String exceptionType;		//异常结果标识0:正常,1:报文格式异常,2:规则执行异常，3:其他异常
	private String exceptionMsg;		// exception_msg
	private String logType;		// 日志类型（1：正式数据，2：测试数据 3:挑战者数据）b
	private String batchNo;
	private String id;
	private Date createDate;
	private String projectName;
	private String totalCount; //数量
	
	public String getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(String totalCount) {
		this.totalCount = totalCount;
	}
	public String getProjectName() {
		return projectName;
	}
	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}
	private List<Map<String, Object>> logs;
	public DeployRuleLogs() {
		super();
	}
	public DeployRuleLogs(String id,String projectCode,String enpterPointer,String ruleParam) {
		this.setId(id);
		this.setProjectCode(projectCode);
		this.setEnterPointer(enpterPointer);
		this.setRuleParam(ruleParam);
		this.setIssuccess("1");
	}
	@Length(min=1, max=50, message="project_code长度必须介于 1 和 50 之间")
	public String getProjectCode() {
		return projectCode;
	}

	public void setProjectCode(String projectCode) {
		this.projectCode = projectCode;
	}
	
	@Length(min=0, max=64, message="ruleflowid长度必须介于 0 和 64 之间")
	public String getRuleflowid() {
		return ruleflowid;
	}

	public void setRuleflowid(String ruleflowid) {
		this.ruleflowid = ruleflowid;
	}
	
	@Length(min=0, max=50, message="enter_pointer长度必须介于 0 和 50 之间")
	public String getEnterPointer() {
		return enterPointer;
	}

	public void setEnterPointer(String enterPointer) {
		this.enterPointer = enterPointer;
	}
	
	@Length(min=0, max=10, message="run_time长度必须介于 0 和 10 之间")
	public String getRunTime() {
		return runTime;
	}

	public void setRunTime(String runTime) {
		this.runTime = runTime;
	}
	
	@Length(min=0, max=10, message="issuccess长度必须介于 0 和 10 之间")
	public String getIssuccess() {
		return issuccess;
	}

	public void setIssuccess(String issuccess) {
		this.issuccess = issuccess;
	}
	
	public String getRuleParam() {
		return ruleParam;
	}

	public void setRuleParam(String ruleParam) {
		this.ruleParam = ruleParam;
	}
	
	public String getRuleResult() {
		return ruleResult;
	}

	public void setRuleResult(String ruleResult) {
		this.ruleResult = ruleResult;
	}
	
	public String getLogContent() {
		return logContent;
	}

	public void setLogContent(String logContent) {
		this.logContent = logContent;
	}
	
	@Length(min=0, max=32, message="exception_type长度必须介于 0 和 32 之间")
	public String getExceptionType() {
		return exceptionType;
	}

	public void setExceptionType(String exceptionType) {
		this.exceptionType = exceptionType;
	}
	
	public String getExceptionMsg() {
		return exceptionMsg;
	}

	public void setExceptionMsg(String exceptionMsg) {
		this.exceptionMsg = exceptionMsg;
	}
	


	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getRuleflowCode() {
		return ruleflowCode;
	}
	public void setRuleflowCode(String ruleflowCode) {
		this.ruleflowCode = ruleflowCode;
	}
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public Date getCreateDate() {
		return createDate;
	}

	public String getLogType() {
		return logType;
	}
	public void setLogType(String logType) {
		this.logType = logType;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public List<Map<String, Object>> getLogs() {
		return logs;
	}
	public void setLogs(List<Map<String, Object>> logs) {
		this.setLogContent(JSON.toJSONString(logs));
		this.logs = logs;
	}
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	
}